﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CloudFox.Weave.Util
{
    public static class WeaveDateTimeConverter
    {
        public static DateTime Convert(string value)
        {
            if (value == null)
                throw new ArgumentNullException("value");
            if (string.IsNullOrEmpty(value))
                throw new ArgumentNullException("The string cannot be empty.", "value");

            double doubleValue = double.Parse(value);

            return Convert(value);
        }

        public static DateTime Convert(double value)
        {
            DateTime dateTime = new DateTime(1970, 1, 1);
            return dateTime.AddSeconds(value);
        }
    }
}
